<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="custom" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<html>
<head>
    <title>用户列表</title>
</head>
<body>
<div class="pageheader">
    <h2>用户列表</h2>
</div>
<div class="contentpanel">
    <div class="btn-group mr10">
        <a href="${contextPath}/admin/user/edit.htm?" class="btn btn-primary" type="button">
            <i class="fa fa-pencil mr5"></i>新增
        </a>
    </div>
    <table class="table table-striped dataTable no-footer" id="table2" role="grid" aria-describedby="table2_info">
        <thead>
        <tr role="row">
            <th class="sorting_asc" tabindex="0" aria-controls="table2" rowspan="1" colspan="1" aria-sort="ascending">名称
            </th>
            <th class="sorting" tabindex="0" aria-controls="table2" rowspan="1" colspan="1">操作
            </th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${listDto.list}" var="item" varStatus="status">
            <tr class="gradeA ${status.index/2 eq 0?"odd":"even"}">
                <td>${item.name}</td>
                <td>
                    <a class="btn btn-primary" href="${contextPath}/admin/user/edit.htm?uuid=${item.uuid}">编辑</a>
                    <shiro:hasPermission name="USER_ACCOUNT:*">
                        <a class="btn btn-info"
                           href="${contextPath}/admin/user_account/list.htm?user_id=${item.uuid}">账号列表</a>
                    </shiro:hasPermission>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>

    <custom:page page="${listDto}"/>
    <c:if test="${not empty param.edit}">
        <script type="text/javascript">
            jQuery.gritter.add({
                title: '更新成功!',
                class_name: "growl-success",
                sticky: false
            });
        </script>
    </c:if>
    <script src="${contextPath}/resources/js/jquery.datatables.min.js"></script>
    <script>
        jQuery(document).ready(function () {
            jQuery('#table2').dataTable({
                "bPaginate": false,// 分页按钮
                "bFilter": false,// 搜索栏
                "bLengthChange": false,// 每行显示记录数
                "bInfo": false
            });
        });
    </script>
</div>
</body>
</html>
